package com.haust.config;

import com.haust.dao.RedisDao;
import com.haust.rabbit.sender.MessageSender;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;
import org.springframework.data.redis.core.RedisTemplate;

@Configuration
public class HaustConsumerConfiguration extends HaustAbstractRedisConfiguration{
    @Bean
    public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory factory) {
        return super.redisTemplate(factory);
    }

    @Bean
    public RedisDao redisDao(RedisTemplate<String, Object> redisTemplate) {
        return super.redisDao(redisTemplate);
    }

    @Bean
    public MessageSender messageSender(AmqpTemplate amqpTemplate){
        MessageSender messageSender = new MessageSender();
        messageSender.setAmqpTemplate(amqpTemplate);
        return messageSender;
    }
}
